package com.app.backendmybatis.controller;

import com.app.backendmybatis.service.UserService;
import com.app.response.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: ZhengJunJie
 * @Date: 2020/5/28 10:39
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/api/get-user/{id}")
    public BaseResponse getUser(@PathVariable int id) {
        return BaseResponse.success(userService.select(id));
    }

}
